<?php session_start() ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Admin Control Panel Logout</title>
<link rel="stylesheet" type="text/css" href="templates/style.css" />
<link rel="stylesheet" type="text/css" href="css/pro.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function () {
 		
		$('#message').html("<h1 id='login'><center><img id='checkmark' src='templates/images/check.png' /> Logged Out Success... </center></h1>")
			.hide()
			.fadeIn(3500, function() {
			  $('#message').html("<h1 id='login'><center><img style='width:40px; heigh: 40px' src='templates/images/processing.gif' /> Redirect you to index...</center></h1>");
			});
			setTimeout(function(){
				$('#success-setting').fadeOut(1500, function() {
					$('#saving').remove();
				});
			},1500);		
		var url = "../index.php";
		setTimeout(function(){
		$(location).attr('href',url);
		},7000);
	
});
</script>
</head>
<?php
	require_once('../includes/config.php');
	$timenow = date("Y-m-d H:i:s");
	$ss = $_SESSION['user_id'];
	$ssid = session_id();
	$sql = "UPDATE tbl_user SET last_login = '$timenow', last_login_session = '$ssid' WHERE id = '$ss'";
	mysql_query("$sql") or die("Some Error Happen");
	$_SESSION['user_id'] = '';
	$_SESSION['user_name'] = '';
	$ss = '';
?>
<body>
<p>&nbsp;</p>
<div id="loginf">
<br />
<br />
<br />
<br />
    <div id="message"></div>
</div>
</body>
</html>